<?php
namespace admin;
use Session;
use View;
use Redirect;
use HomeController;

class AdminController extends \BaseController {
   
	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{
		 //Kiểm tra đăng nhập
	 	 if (HomeController::ktDangNhap()){
	  		return View::make("admin.admin");
	  	 }
	  	else{
	  		return View::make("admin.login");
	  	}
	}
	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function phanLoaiChucNang($chuc_nang)
	{
		// if (AdminController::ktDangNhap()){
		$chucnang=0;
		$tenchucnang=0;
		$store=0;

		if ($chuc_nang == "monhoc" ){
			return Redirect::route('quanlyghichu.monhoc.index');
        }
        elseif($chuc_nang == "monhoc_add"){
    		return Redirect::route('quanlyghichu.monhoc.create');
        }
  
        elseif($chuc_nang == "dashboard"){
    		return Redirect::route('quanlyghichu.dashboard.index');
        }
        elseif($chuc_nang == "chuong"){
    		return Redirect::route('quanlyghichu.chuong.index');
        }
        elseif($chuc_nang == "ghichu"){
    		return Redirect::route('quanlyghichu.ghichu.index');
        }
	  	//  }
	  	//  else{
	  	// 	return View::make("admin.login");
	  	// }
	}

	public function create()
	{
		//
		echo 'create';	
	}


	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}
	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{

	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}


	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}


	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}


}
